<style>textarea{width:500px;height:180px}.br td{border-right:1px solid #ddd;background-color:#eee;cursor:pointer}td input[type=text]{text-align:center}.dropdown{margin-right:15px}.table-wrap .table-grid{min-height:30px}.small-blue-button{margin-top:10px}.subject input[type=text]{margin-bottom:8px;margin-left:16px}.subject-title .toolbar-btns,.subject-title h5{display:inline-block;vertical-align:middle}.subject-title .toolbar-btns{display:inline-block;vertical-align:middle;margin-top:5px;float:right}.subject-title h5{display:inline-block;vertical-align:middle;max-width:500px;line-height:20px}.btn{display:inline-block}.subjects .subject .template-grid{margin:15px 0}.subject .checkbox-group span{margin-right:10px}.subject .option input[type=text]{margin-bottom:0}</style>
<div class="main-panel container-fluid">
    <div class="card card-wizard">
        <!--新建-->
        <div class="h-title" ng-if="!isPreview && !isEdit" ng-cloak="">创建空白问卷</div>
        <!--编辑-->
        <div class="h-title" ng-if="!isPreview && isEdit" ng-cloak="">编辑问卷&nbsp;&nbsp;<a ng-click="$parent.isPreview=true">预览</a></div>
        <!--预览-->
        <div class="h-title" ng-if="isPreview" ng-cloak="">预览问卷&nbsp;&nbsp;<a ng-click="$parent.isPreview=false">编辑</a></div>
        <div class="table-wrap">
            <div class="table-grid">
                <!--新建|编辑-->
                <table class="br" ng-if="!isPreview" ng-cloak="">
                    <tr>
                        <td class="black" ng-click="createNew($event,1)"><i class="fa fa-plus"></i>单选</td>
                        <td class="black" ng-click="createNew($event,2)"><i class="fa fa-plus"></i>多选</td>
                        <td class="black" ng-click="createNew($event,3)"><i class="fa fa-plus"></i>填空</td>
                        <!--<td class="black" ng-click="createNew($event,4)"><i class="fa fa-plus"></i>评分</td>-->
                        <!--<td class="black" ng-click="createNew($event,5)"><i class="fa fa-plus"></i>下拉框</td>-->
                    </tr>
                </table>
                <div ng-if="editIndex==questionArray.length" ng-cloak="" ng-include="'/components/quiz/question.html'"></div>
                <!--问题列表-->
                <ul class="subjects">
                    <li class="subject" ng-repeat="subject in questionArray track by $index" ng-cloak="">
                        <div class="inner-subject" ng-if="editIndex!=$index">
                            <div class="subject-title">
                                <h5 ng-cloak="">{{$index+1}}.&nbsp;&nbsp;{{subject.title}}</h5>
                                <div class="toolbar-btns" ng-if="!isPreview">
                                    <span class="orange" ng-click="editQuestion($event,subject,$index)">编辑</span>
                                    <!--<span ng-click="cloneQuestion($event,subject,$index)">复制</span>-->
                                    <span ng-click="deleteQuestion($event,subject,$index)">删除</span>
                                    <!--<span ng-click="upMoveQuestion($event,subject,$index)">上移</span>-->
                                    <!--<span ng-click="downMoveQuestion($event,subject,$index)">下移</span>-->
                                    <!--<span ng-click="toFirstQuestion($event,subject,$index)">最前</span>-->
                                    <!--<span ng-click="toLastQuestion($event,subject,$index)">最后</span>-->
                                </div>
                            </div>
                            <!--单选|复选-->
                            <div ng-if="questionTypes[subject.type]=='单选'||questionTypes[subject.type]=='多选'||questionTypes[subject.type]=='评分题'" class="options">
                                <div class="option" ng-repeat="item in subject.options track by $index">
                                    <input ng-if="questionTypes[subject.type]=='单选'||questionTypes[subject.type]=='评分题'" type="radio"/>
                                    <input ng-if="questionTypes[subject.type]=='多选'" type="checkbox"/>
                                    <span ng-bind="item.text"></span>
                                    <img ng-src="{{item.resource}}" alt=""/>
                                    <input ng-if="item.fillable" type="text"/>
                                </div>
                            </div>
                            <!--<div ng-if="questionTypes[subject.type]=='下拉框'" class="options">-->
                            <!--<div class="ngDropdown" ng-cloak="" n="5" options="subject.options" label="text" value="text" ng-model="selected" style="margin-left:16px;"></div>-->
                            <!--</div>-->
                            <!--填空-->
                            <div ng-if="questionTypes[subject.type]=='填空'">
                                <input class="line" type="text"/>
                            </div>
                        </div>
                        <div ng-if="editIndex==$index" ng-cloak="" ng-include="'/components/quiz/question.html'"></div>
                    </li>
                </ul>
            </div>
        </div>
        <div class="footer clear">
            <button type="button" class="btn btn-default btn-fill btn-wd pull-left" style="display: block;" ng-click="goBack($event)">返回</button>
            <button type="button" ng-if="!isPreview" class="btn btn-info btn-fill btn-wd btn-finish pull-right" ng-click="$parent.isPreview=true">预览问卷</button>
            <button type="button" ng-if="isPreview" class="btn btn-info btn-fill btn-wd pull-right" ng-click="$parent.isPreview=false">编辑问卷</button>
        </div>
    </div>
</div>
